{{- if (.Values.global.enabledModules | has "prometheus-crd") }}
---
apiVersion: deckhouse.io/v1alpha1
kind: GrafanaAdditionalDatasource
metadata:
  name: d8-{{ .Chart.Name }}
  {{- include "helm_lib_module_labels" (list . (dict "app" .Chart.Name)) | nindent 2 }}
spec:
  type: loki
  access: proxy
  url: "https://loki.d8-monitoring:3100"
  basicAuth: false
  jsonData:
    timeInterval: 30s
    maxLines: 5000
    tlsSkipVerify: true
    httpHeaderName1: 'Authorization'
  secureJsonData:
    httpHeaderValue1: 'Bearer {{ .Values.loki.internal.grafanaToken }}'
{{- end }}
